﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.Metadata.Entity.Page;
using T.ServiceComponent.DAC.Service;
using T.ServiceComponent.Database.Service;

namespace T.FAS.Runtime.Page.Dao
{
    public class PageEntryDao : DaoService<PageEntry>
    {
        public PageEntryDao() :
           base()
        {
            DBName = "TFAS";
        }

        public override string TableName => "FAS_PageEntry";
        public override string IDColumnName => "ID";
        public List<PageEntry> GetPageEntrys(string pageID)
        {
            var result = new List<PageEntry>();
            List<object> objects = base.GetObjectsByFilter(string.Format("PageID='{0}'", pageID));
            if (objects != null)
            {
                objects.ForEach(obj => result.Add(obj as PageEntry));
            }
            return result;
        }
    }
}
